package zhangqi.com.ipcall;

import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void click(View view) {
        EditText et = (EditText) findViewById(R.id.et);
        String ipName = et.getText().toString();

        SharedPreferences sp = getSharedPreferences("ip",MODE_PRIVATE);
        SharedPreferences.Editor ed = sp.edit();
        ed.putString("ipNumber",ipName);
        ed.commit();

        Toast.makeText(this,"保存好了",Toast.LENGTH_LONG).show();
    }
}
